Today's electronic devices may communicate with each other using commonly understood communication protocols. These communication protocols can implement communication protocol frame structures that include a combination of data bits and overhead bits. For example, in one type of frame structure, fixed-size blocks of data bits can be separated by variable-size blocks of overhead bits. The overhead bits are included in the frame structure to enable implementation of communication control functions. Before the data bits in the frame structure can be utilized by a receiving device, the overhead bits need to be removed from their interspersed positions within the data bits. Thus, the receiving device is tasked with extracting the overhead bits from a data stream defined in accordance with the frame structure. The receiving device is also tasked with shifting the data bits together to fill empty bit positions that had been occupied by the extracted overhead bits. Upon completion of these tasks, the resulting contiguous data is suitable for further processing by the receiving device.
Conventionally, extraction of the overhead bits from the data stream and shifting of the data bits together is accomplished using a barrel shifter and shift register. The barrel shifter functions to realign the data bits such that the overhead bits are squeezed out of the data stream. The realigned data is then appended to the end of the shift register. When a number of data bits corresponding to an output word size are present in the shift register, the number of data bits are shifted out of the shift register.
Those skilled in the art should appreciate that barrel shifters are large and complex because each input bit needs to be capable of going to each output bit. For example, a 32-bit barrel shifter would require 32, 32-to-1 multiplexers. Also, when applied to extract data from a frame structure having fixed-size blocks of data bits separated by variable-size blocks of overhead bits, the complexity and size of the barrel shifter logic and the shifter register control logic is further increased to account for the variability in the size of the blocks of overhead bits and the corresponding variability in the amount of data bit shifting required. Thus, when implemented in a programmable logic device (PLD), the barrel shifter and shift register control logic consumes a large number of logic elements. Also, the complex logic required for the barrel shifter and shift register control logic can introduce a four stage latency, or more, in shifting the received data out for further processing by the receiving device. Thus, use of the barrel shifter and shift register for extracting control bits from a data stream can slow down the rate of communication. Additionally, routing of the data between the barrel shifter and the shift register can become quite difficult, particularly when implemented in a PLD.
In view of the foregoing, a more efficient solution is needed for removing overhead bits and recovering data bits from a received communication protocol frame data stream.